<?php

namespace app\common\model;

use think\Model;
use app\common\model\Base;

class Category extends Base {

    // 模型名称
    public function getModelsTextAttr($value, $data) {


        return db('models')->where('id', $data['models_id'])->value('title');
    }

    //
    public function model_where($wheres = []) {

        $this->join('models m', 'm.id = a.models_id');

        $this->field('a.*,m.name as models_name,m.title as models_title,m.fields,m.list_grid');

        $this->alias('a');
        return $this;
    }

}
